<?php

namespace app\index\controller\goods;

use app\common\controller\Frontend;
use app\common\model\goods\Orders as OrdersModel;
use think\Exception;

/**
 * 充值
 */
class Order extends Frontend
{
    protected $layout = 'default';
    protected $noNeedLogin = [];
    protected $noNeedRight = ['*'];
	protected $model;

	public function _initialize(){
        parent::_initialize();

		$this->model = new OrdersModel();
	}

    /**
     * 商品列表
     * @return string
     */
    public function index()
    {
		$list = $this->model->where(['user_id' => $this->auth->id])
            ->order('id desc')
            ->paginate(10);

        $this->view->assign('title', __('我的订单'));
        $this->view->assign('list', $list);

        return $this->view->fetch();
    }
}
